<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>闭包</title>
	</head>
	<body>
		<script>
			// Math.pow(4, 2)
			// Math.pow(5, 2)

			function makePow(power) {
				return function (num) {
					return Math.pow(num, power);
				};
			}

			//  平方
			let pow2 = makePow(2);
			let pow3 = makePow(3);

			console.log(pow2(4));
			console.log(pow2(5));
			console.log(pow3(4));
		</script>
	</body>
</html>
